<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="DistributionJobDayUser" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="599ee8c7-36d1-40df-b5c3-fdb24a51e7e6">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="sdate" class="java.lang.String"/>
	<parameter name="date" class="java.util.Date"/>
	<parameter name="user" class="java.lang.String"/>
	<parameter name="user_id" class="java.lang.Long">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[(SELECT '00' AS H, COUNT(*) AS C FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 00:00:00' AND '$P!{sdate} 01:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '01', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 01:00:00' AND '$P!{sdate} 02:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '02', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 02:00:00' AND '$P!{sdate} 03:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '03', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 03:00:00' AND '$P!{sdate} 04:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '04', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 04:00:00' AND '$P!{sdate} 05:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '05', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 05:00:00' AND '$P!{sdate} 06:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '06', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 06:00:00' AND '$P!{sdate} 07:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '07', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 07:00:00' AND '$P!{sdate} 08:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '08', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 08:00:00' AND '$P!{sdate} 09:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '09', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 09:00:00' AND '$P!{sdate} 10:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '10', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 10:00:00' AND '$P!{sdate} 11:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '11', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 11:00:00' AND '$P!{sdate} 12:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '12', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 12:00:00' AND '$P!{sdate} 13:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '13', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 13:00:00' AND '$P!{sdate} 14:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '14', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 14:00:00' AND '$P!{sdate} 15:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '15', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 15:00:00' AND '$P!{sdate} 16:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '16', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 16:00:00' AND '$P!{sdate} 17:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '17', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 17:00:00' AND '$P!{sdate} 18:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '18', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 18:00:00' AND '$P!{sdate} 19:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '19', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 19:00:00' AND '$P!{sdate} 20:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '20', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 20:00:00' AND '$P!{sdate} 21:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '21', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 21:00:00' AND '$P!{sdate} 22:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '22', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 22:00:00' AND '$P!{sdate} 23:00:00' AND user_id=$P{user_id}) UNION ALL
(SELECT '23', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 23:00:00' AND '$P!{sdate} 23:59:59' AND user_id=$P{user_id})]]>
	</queryString>
	<field name="H" class="java.lang.String">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="C" class="java.lang.Integer">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<variable name="amount" class="java.lang.Integer" calculation="Sum">
		<variableExpression><![CDATA[$F{C}]]></variableExpression>
		<initialValueExpression><![CDATA[new java.lang.Integer(0)]]></initialValueExpression>
	</variable>
	<title>
		<band height="89">
			<line>
				<reportElement uuid="5a125e5b-8365-4897-b299-d7d7d8978cbe" x="0" y="8" width="555" height="1"/>
			</line>
			<line>
				<reportElement uuid="4bbcaf48-2cd2-4735-84c9-79f462552b0d" positionType="FixRelativeToBottom" x="0" y="81" width="555" height="1"/>
			</line>
			<staticText>
				<reportElement uuid="6492e39a-4388-4aac-8b68-a02e254addb3" x="1" y="9" width="551" height="24"/>
				<textElement textAlignment="Center">
					<font fontName="SansSerif" size="18" isBold="true" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<text><![CDATA[Распределение нагрузки внутри дня ]]></text>
			</staticText>
			<textField>
				<reportElement uuid="11698abd-c99f-47ec-8d98-6f26bddb869e" x="1" y="33" width="551" height="24"/>
				<textElement textAlignment="Center">
					<font fontName="SansSerif" size="18" isBold="true" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA["для пользователя \"" + $P{user} +"\""]]></textFieldExpression>
			</textField>
			<textField pattern="">
				<reportElement uuid="44b5fcde-0029-4022-8aa6-47d6a4d07098" x="1" y="57" width="551" height="24"/>
				<textElement textAlignment="Center">
					<font fontName="SansSerif" size="18" isBold="true" isUnderline="false" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA["на дату " + (new java.text.SimpleDateFormat("dd.MM.yyyy")).format($P{date})]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band/>
	</pageHeader>
	<columnHeader>
		<band height="395">
			<barChart>
				<chart isShowLegend="false" evaluationTime="Report">
					<reportElement uuid="8225b0ad-320d-4eee-a956-5cb01eecbc7a" x="0" y="0" width="555" height="340"/>
					<chartTitle/>
					<chartSubtitle>
						<font fontName="SansSerif" size="14" isBold="false" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
					</chartSubtitle>
					<chartLegend/>
				</chart>
				<categoryDataset>
					<categorySeries>
						<seriesExpression><![CDATA[new java.lang.Integer(1)]]></seriesExpression>
						<categoryExpression><![CDATA[$F{H}]]></categoryExpression>
						<valueExpression><![CDATA[$F{C}]]></valueExpression>
					</categorySeries>
				</categoryDataset>
				<barPlot isShowTickMarks="false">
					<plot/>
					<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
					<categoryAxisLabelExpression><![CDATA["часы"]]></categoryAxisLabelExpression>
					<categoryAxisFormat>
						<axisFormat/>
					</categoryAxisFormat>
					<valueAxisLabelExpression><![CDATA["количество посетителей"]]></valueAxisLabelExpression>
					<valueAxisFormat>
						<axisFormat/>
					</valueAxisFormat>
				</barPlot>
			</barChart>
			<textField evaluationTime="Report">
				<reportElement uuid="a1282f4b-a342-4967-837e-38a1a0bc1ae5" x="1" y="340" width="554" height="20"/>
				<textElement textAlignment="Center">
					<font size="12" isBold="true" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA["Количество посетителей за день: " + $V{amount}]]></textFieldExpression>
			</textField>
		</band>
	</columnHeader>
	<pageFooter>
		<band height="21">
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement uuid="27ff3466-4935-4de7-9593-1a4ce235a4dd" key="textField" x="516" y="2" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font fontName="SansSerif" size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement uuid="d3550c80-7c45-42bb-8c79-b7e8d590754e" key="textField" x="296" y="2" width="216" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right">
					<font fontName="SansSerif" size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA["Страница " + $V{PAGE_NUMBER} + " из "]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement uuid="28061468-5e92-4a9d-9030-cab6811367f7" key="textField" x="1" y="2" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font fontName="SansSerif" size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[new Date()]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
</jasperReport>
